import {http} from './http'
// 首页轮播图
const getswiper = () =>{
  return http('home/swiperdata',{method:'get'})
}
// tap数据
const gettap = ()=>{
  return http('home/catitems',{method:'get'})
}
//楼层数据
const getfoolr = () =>{
  return http('home/floordata',{method:'get'})
}
// 分类侧边栏
const getcateleft = ()=>{
    return http('categories',{method:'get'})
  }
  //搜索接口
  const getsearch =(query)=>{
    return http(`goods/search?query=${query}`,{method:'get'})
  }
  // 商品列表
  const getgoodslist = (data)=>{
    return http(`goods/search?query=${data}`,{method:'get'})
  }
  // 商品详情
  const getdetails = (data)=>{
    return http(`goods/detail?goods_id=${data}`,{method:'get'})
  }
  //登录
  const login =(data)=>{
    return http(`users/wxlogin`,{method:'post'},data)
  }

  //创建订单
  const getorder = (data)=>{
    return http(`my/orders/create`,{method:'post'},data)
  }
  //获取预支付的数据
  const getpay = (data)=>{
    return http(`my/orders/req_unifiedorder`,{method:'post'},data)
  }
  // 历史订单查询
  const searchorder = (data) =>{
    return http(`my/orders/all`,{method:'get'},data)
  }
  // 查看订单支付状态
  const getpayzhuangtai = (data) =>{
    return http(`my/orders/chkOrder`,{method:'post'},data)
  }
export {getswiper,gettap,getfoolr,getpayzhuangtai,searchorder,getorder,getpay,getcateleft ,getsearch,getgoodslist,getdetails,login}